package com.shxzz.shortlink.project.common.convention.exception;


import com.shxzz.shortlink.project.common.convention.errorcode.BaseErrorCode;
import com.shxzz.shortlink.project.common.convention.errorcode.ErrorCode;

/**
 * @author shxzz
 * @create 2023-12-08-19:57
 */
public class ServiceException extends BaseException {

    public ServiceException(ErrorCode errorCode) {
        this(null, null, errorCode);
    }

    public ServiceException(String message) {
        this(message, null, BaseErrorCode.SERVICE_ERROR);
    }

    public ServiceException(String message, Throwable cause, ErrorCode errorCode) {
        super(message, cause, errorCode);
    }

    @Override
    public String toString() {
        return "ServiceException { " +
                "code='" + errorCode + "', " +
                "message='" + errorMsg + "'" +
                " }";
    }
}
